{{include 'share/header'}}
{{include 'share/navbar'}}
<div class="container question">
{{each question as q i}}
	<ul class="list-group">
		<li class="list-group-item list-group-item-success list-relative">
			<div class="list-header">
				<img src=uploads/{{q.ownerId.header}} onerror="this.src='images/user.png'" alt="" />
				<div class="info">
					<span>{{q.ownerId.username}}</span>
					<span>{{q.createTime | getTime}}</span>
				</div>
			</div>
			<div class="list-body">
				<p>{{q.content}}</p>
			</div>
			<button class="btn  answer" data-id={{q.id}}>点我回答</button>
			<button class="btn  remove" data-id={{q.id}}>点我删除</button>
		</li>
		   {{each q.ans as answer}}
		       {{include 'share/answers' answer}}
		   {{/each}}
	</ul>	
{{/each}}

{{if pages}}
	<nav class="pages">
		  <ul class="pagination">
		    <li {{if page==1}}class="disabled"{{/if}}><a href="#">&laquo;</a></li>
		    {{each pages as p i}}
		    <li {{if p==page}}class="active"{{/if}}><a href="/?page={{p}}" >{{p}}</a></li>
		    {{/each}}
		    
		    <li {{if page==count}}class="disabled"{{/if}}><a href="#">&raquo;</a></li>
		  </ul>
	</nav>
{{/if}}
</div>     

<script src="js/index.js"></script>
{{include 'share/modal'}}
{{include 'share/footer'}}